package edu.njpi.vueajax.mapper;

import edu.njpi.vueajax.model.Product;
import org.apache.ibatis.annotations.*;

import java.util.Date;
import java.util.List;

@Mapper
public interface ProductMapper {
    @Select("select * from product")
    List<Product> getAllProducts();

    @Select("select * from products where prodid = #{id}")
    Product getProductById(int id);

    @Insert("insert into product (prodname) values(#{name})")
    boolean saveProduct(String name);

    @Delete("delete from product where prodid=#{id}")
    boolean deleteProductById(int id);
}
